﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using JM.JCY.BusinessEntity;
using JM.JCY.Proxy;
using NCS.IConnect.ApplicationContexts;
using JM.JCY.Common;
using JM.JCY.Common.Utilities;
using Microsoft.SharePoint;

namespace JM.JCY.SharePointComponent.IncorruptArchives.LingDaoDangFengCheckDetails
{
    public partial class LingDaoDangFengCheckDetailsUserControl : UserControl
    {
        public int _caseId
        {
            set { ViewState["_caseId"] = value; }
            get { return (int)ViewState["_caseId"]; }
        }

        public string _isApproval
        {
            set { ViewState["_isApproval"] = value; }
            get { return (string)ViewState["_isApproval"]; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                using (IncorruptProxy proxy = new IncorruptProxy())
                {
                    if (Request.QueryString["CaseId"] != null)
                    {
                        _caseId = Int32.Parse(Request.QueryString["CaseId"].ToString());
                        _isApproval = Request.QueryString["IsApproval"].ToString();

                        var loadDT = proxy.GetLingDaoDangFengCheck(_caseId, string.Empty);
                        Session["EditLingDaoDangFengCheckDT"] = loadDT;
                        LoadForView(loadDT);
                        LoadForEdit(loadDT);

                    }
                }

            }

            // switch controls
            if (this.hfIsEdit.Value != "1")
                SwitchControls(true, false);
            else
                SwitchControls(false, true);
        }

        private void LoadForEdit(IncorruptDataSet.T_LingDaoDangFengCheckDataTable loadDT)
        {
            var loadRow = loadDT[0];
            //个人信息
            this.txtName.Text = loadRow.Name;
            this.rbGender.SelectedValue = loadRow.Gender;
            this.hfDOB.Value = loadRow.DOB.ToString();
            this.txtNationality.Text = loadRow.Nationality;
            this.txtCultureDegree.Text = loadRow.CultureDegree;
            this.txtCurrentJobDay.Text = loadRow.CurrentJobDay;
            this.txtCompanyPosition.Text = loadRow.CompanyPosition;
            //配偶信息
            this.txtSpouseName.Text = loadRow.SpouseName;
            this.rbSpouseGender.SelectedValue = loadRow.SpouseGender;
            this.hfSpouseDOB.Value = loadRow.SpouseDOB.ToString();
            this.txtSpouseNationality.Text = loadRow.SpouseNationality;
            this.txtSpouseCultureDegree.Text = loadRow.SpouseCultureDegree;
            this.txtSpouseCurrentJobDay.Text = loadRow.SpouseCurrentJobDay;
            this.txtSpouseCompanyPosition.Text = loadRow.SpouseCompanyPosition;

            //（二）执行党风廉政建设责任制（对照检查高检院《实施办法》中职责内容填写）
            this.txtSection2.Text = loadRow.Section2;

            //(三)廉洁自律及重大事项情况

            this.txtHouseAddress.Text = loadRow.HouseAddress;
            this.txtHouseSize.Text = loadRow.HouseSize;
            this.txtHouseType.Text = loadRow.HouseType;
            this.txtOtherHouseAddress.Text = loadRow.OtherHouseAddress;
            this.txtOtherHouseSize.Text = loadRow.OtherHouseSize;
            this.txtOtherHouseType.Text = loadRow.OtherHouseType;

            this.txtBusinessTravelTime.Text = loadRow.BusinessTravelTime;
            this.txtBusinessTravelReason.Text = loadRow.BusinessTravelReason;
            this.txtBusinessTravelArea.Text = loadRow.BusinessTravelArea;
            this.txtBusinessTravelSpenseSource.Text = loadRow.BusinessTravelSpenseSource;

            this.txtPersonalTravelTime1.Text = loadRow.PersonalTravelTime1;
            this.txtPersonalTravelReason1.Text = loadRow.PersonalTravelReason1;
            this.txtPersonalTravelArea1.Text = loadRow.PersonalTravelArea1;
            this.txtPersonalTravelSpenseSource1.Text = loadRow.PersonalTravelSpenseSource1;

            this.txtPersonalTravelTime2.Text = loadRow.PersonalTravelTime2;
            this.txtPersonalTravelReason2.Text = loadRow.PersonalTravelReason2;
            this.txtPersonalTravelArea2.Text = loadRow.PersonalTravelArea2;
            this.txtPersonalTravelSpenseSource2.Text = loadRow.PersonalTravelSpenseSource2;

            this.txtCarGeneral.Text = loadRow.CarGeneral;
            this.txtCarBrand.Text = loadRow.CarBrand;
            this.txtCarDisplacement.Text = loadRow.CarDisplacement;
            this.txtCarPrice.Text = loadRow.CarPrice;

            this.txtPhoneClaimYear.Text = loadRow.PhoneClaimYear;
            this.txtMobilePhoneClaimStandard.Text = loadRow.MobilePhoneClaimStandard;
            this.txtMobilePhoneActualClaim.Text = loadRow.MobilePhoneActualClaim;
            this.txtHomePhoneClaimStandard.Text = loadRow.HomePhoneClaimStandard;
            this.txtHomePhoneActualClaim.Text = loadRow.HomePhoneActualClaim;

            this.txtRelatedName1.Text = loadRow.RelatedName1;
            this.txtRelationShip1.Text = loadRow.RelationShip1;
            this.txtRelatedJobType1.Text = loadRow.RelatedJobType1;
            this.txtRelatedCompany1.Text = loadRow.RelatedCompany1;
            this.txtRelatedPosition1.Text = loadRow.RelatedPosition1;

            this.txtRelatedName2.Text = loadRow.RelatedName2;
            this.txtRelationShip2.Text = loadRow.RelationShip2;
            this.txtRelatedJobType2.Text = loadRow.RelatedJobType2;
            this.txtRelatedCompany2.Text = loadRow.RelatedCompany2;
            this.txtRelatedPosition2.Text = loadRow.RelatedPosition2;

            this.txtRelatedName3.Text = loadRow.RelatedName3;
            this.txtRelationShip3.Text = loadRow.RelationShip3;
            this.txtRelatedJobType3.Text = loadRow.RelatedJobType3;
            this.txtRelatedCompany3.Text = loadRow.RelatedCompany3;
            this.txtRelatedPosition3.Text = loadRow.RelatedPosition3;

            this.txtRelatedName4.Text = loadRow.RelatedName4;
            this.txtRelationShip4.Text = loadRow.RelationShip4;
            this.txtRelatedJobType4.Text = loadRow.RelatedJobType4;
            this.txtRelatedCompany4.Text = loadRow.RelatedCompany4;
            this.txtRelatedPosition4.Text = loadRow.RelatedPosition4;

            this.txtPeculationYear1.Text = loadRow.PeculationYear1;
            this.txtPeculationTotalTimes1.Text = loadRow.PeculationTotalTimes1;
            this.txtPeculationTotalAmount1.Text = loadRow.PeculationTotalAmount1;
            this.txtCandorTotalAmount1.Text = loadRow.CandorTotalAmount1;
            this.txtPeculationTotalCount1.Text = loadRow.PeculationTotalCount1;
            this.txtCandorTotalCount1.Text = loadRow.CandorTotalCount1;

            this.txtPeculationYear2.Text = loadRow.PeculationYear2;
            this.txtPeculationTotalTimes2.Text = loadRow.PeculationTotalTimes2;
            this.txtPeculationTotalAmount2.Text = loadRow.PeculationTotalAmount2;
            this.txtCandorTotalAmount2.Text = loadRow.CandorTotalAmount2;
            this.txtPeculationTotalCount2.Text = loadRow.PeculationTotalCount2;
            this.txtCandorTotalCount2.Text = loadRow.CandorTotalCount2;

            this.txtPeculationYear3.Text = loadRow.PeculationYear3;
            this.txtPeculationTotalTimes3.Text = loadRow.PeculationTotalTimes3;
            this.txtPeculationTotalAmount3.Text = loadRow.PeculationTotalAmount3;
            this.txtCandorTotalAmount3.Text = loadRow.CandorTotalAmount3;
            this.txtPeculationTotalCount3.Text = loadRow.PeculationTotalCount3;
            this.txtCandorTotalCount3.Text = loadRow.CandorTotalCount3;

            this.txtPeculationYear4.Text = loadRow.PeculationYear4;
            this.txtPeculationTotalTimes4.Text = loadRow.PeculationTotalTimes4;
            this.txtPeculationTotalAmount4.Text = loadRow.PeculationTotalAmount4;
            this.txtCandorTotalAmount4.Text = loadRow.CandorTotalAmount4;
            this.txtPeculationTotalCount4.Text = loadRow.PeculationTotalCount4;
            this.txtCandorTotalCount4.Text = loadRow.CandorTotalCount4;

            this.txtPeculationYear5.Text = loadRow.PeculationYear5;
            this.txtPeculationTotalTimes5.Text = loadRow.PeculationTotalTimes5;
            this.txtPeculationTotalAmount5.Text = loadRow.PeculationTotalAmount5;
            this.txtCandorTotalAmount5.Text = loadRow.CandorTotalAmount5;
            this.txtPeculationTotalCount5.Text = loadRow.PeculationTotalCount5;
            this.txtCandorTotalCount5.Text = loadRow.CandorTotalCount5;

            //(三)廉洁自律及重大事项情况（本人认为其他需要向组织报告的重大事项）
            this.txtSection3Others.Text = loadRow.Section3Others;

            //（四）领导班子主要领导审核意见
            this.txtSection4.Text = loadRow.Section4;

            //（五）检查考评组审核意见
            this.txtSection5.Text = loadRow.Section5;

            this.hfFillDate.Value = loadRow.FillDate.ToString();
        }

        private void LoadForView(IncorruptDataSet.T_LingDaoDangFengCheckDataTable loadDT)
        {
            var loadRow = loadDT[0];
            //个人信息
            this.lblName.Text = loadRow.Name;
            this.lblGender.Text = loadRow.Gender;
            this.lblDOB.Text = loadRow.DOB.ToString(JCYConstant.Date_Format_CN);
            this.lblNationality.Text = loadRow.Nationality;
            this.lblCultureDegree.Text = loadRow.CultureDegree;
            this.lblCurrentJobDay.Text = loadRow.CurrentJobDay;
            this.lblCompanyPosition.Text = loadRow.CompanyPosition;
            //配偶信息
            this.lblSpouseName.Text = loadRow.SpouseName;
            this.lblSpouseGender.Text = loadRow.SpouseGender;
            this.lblSpouseDOB.Text = loadRow.SpouseDOB.ToString(JCYConstant.Date_Format_CN);
            this.lblSpouseNationality.Text = loadRow.SpouseNationality;
            this.lblSpouseCultureDegree.Text = loadRow.SpouseCultureDegree;
            this.lblSpouseCurrentJobDay.Text = loadRow.SpouseCurrentJobDay;
            this.lblSpouseCompanyPosition.Text = loadRow.SpouseCompanyPosition;

            //（二）执行党风廉政建设责任制（对照检查高检院《实施办法》中职责内容填写）
            this.lblSection2.Text = loadRow.Section2;

            //(三)廉洁自律及重大事项情况

            this.lblHouseAddress.Text = loadRow.HouseAddress;
            this.lblHouseSize.Text = loadRow.HouseSize;
            this.lblHouseType.Text = loadRow.HouseType;
            this.lblOtherHouseAddress.Text = loadRow.OtherHouseAddress;
            this.lblOtherHouseSize.Text = loadRow.OtherHouseSize;
            this.lblOtherHouseType.Text = loadRow.OtherHouseType;

            this.lblBusinessTravelTime.Text = loadRow.BusinessTravelTime;
            this.lblBusinessTravelReason.Text = loadRow.BusinessTravelReason;
            this.lblBusinessTravelArea.Text = loadRow.BusinessTravelArea;
            this.lblBusinessTravelSpenseSource.Text = loadRow.BusinessTravelSpenseSource;

            this.lblPersonalTravelTime1.Text = loadRow.PersonalTravelTime1;
            this.lblPersonalTravelReason1.Text = loadRow.PersonalTravelReason1;
            this.lblPersonalTravelArea1.Text = loadRow.PersonalTravelArea1;
            this.lblPersonalTravelSpenseSource1.Text = loadRow.PersonalTravelSpenseSource1;

            this.lblPersonalTravelTime2.Text = loadRow.PersonalTravelTime2;
            this.lblPersonalTravelReason2.Text = loadRow.PersonalTravelReason2;
            this.lblPersonalTravelArea2.Text = loadRow.PersonalTravelArea2;
            this.lblPersonalTravelSpenseSource2.Text = loadRow.PersonalTravelSpenseSource2;

            this.lblCarGeneral.Text = loadRow.CarGeneral;
            this.lblCarBrand.Text = loadRow.CarBrand;
            this.lblCarDisplacement.Text = loadRow.CarDisplacement;
            this.lblCarPrice.Text = loadRow.CarPrice;

            this.lblPhoneClaimYear.Text = loadRow.PhoneClaimYear;
            this.lblMobilePhoneClaimStandard.Text = loadRow.MobilePhoneClaimStandard;
            this.lblMobilePhoneActualClaim.Text = loadRow.MobilePhoneActualClaim;
            this.lblHomePhoneClaimStandard.Text = loadRow.HomePhoneClaimStandard;
            this.lblHomePhoneActualClaim.Text = loadRow.HomePhoneActualClaim;

            this.lblRelatedName1.Text = loadRow.RelatedName1;
            this.lblRelationShip1.Text = loadRow.RelationShip1;
            this.lblRelatedJobType1.Text = loadRow.RelatedJobType1;
            this.lblRelatedCompany1.Text = loadRow.RelatedCompany1;
            this.lblRelatedPosition1.Text = loadRow.RelatedPosition1;

            this.lblRelatedName2.Text = loadRow.RelatedName2;
            this.lblRelationShip2.Text = loadRow.RelationShip2;
            this.lblRelatedJobType2.Text = loadRow.RelatedJobType2;
            this.lblRelatedCompany2.Text = loadRow.RelatedCompany2;
            this.lblRelatedPosition2.Text = loadRow.RelatedPosition2;

            this.lblRelatedName3.Text = loadRow.RelatedName3;
            this.lblRelationShip3.Text = loadRow.RelationShip3;
            this.lblRelatedJobType3.Text = loadRow.RelatedJobType3;
            this.lblRelatedCompany3.Text = loadRow.RelatedCompany3;
            this.lblRelatedPosition3.Text = loadRow.RelatedPosition3;

            this.lblRelatedName4.Text = loadRow.RelatedName4;
            this.lblRelationShip4.Text = loadRow.RelationShip4;
            this.lblRelatedJobType4.Text = loadRow.RelatedJobType4;
            this.lblRelatedCompany4.Text = loadRow.RelatedCompany4;
            this.lblRelatedPosition4.Text = loadRow.RelatedPosition4;

            this.lblPeculationYear1.Text = loadRow.PeculationYear1;
            this.lblPeculationTotalTimes1.Text = loadRow.PeculationTotalTimes1;
            this.lblPeculationTotalAmount1.Text = loadRow.PeculationTotalAmount1;
            this.lblCandorTotalAmount1.Text = loadRow.CandorTotalAmount1;
            this.lblPeculationTotalCount1.Text = loadRow.PeculationTotalCount1;
            this.lblCandorTotalCount1.Text = loadRow.CandorTotalCount1;

            this.lblPeculationYear2.Text = loadRow.PeculationYear2;
            this.lblPeculationTotalTimes2.Text = loadRow.PeculationTotalTimes2;
            this.lblPeculationTotalAmount2.Text = loadRow.PeculationTotalAmount2;
            this.lblCandorTotalAmount2.Text = loadRow.CandorTotalAmount2;
            this.lblPeculationTotalCount2.Text = loadRow.PeculationTotalCount2;
            this.lblCandorTotalCount2.Text = loadRow.CandorTotalCount2;

            this.lblPeculationYear3.Text = loadRow.PeculationYear3;
            this.lblPeculationTotalTimes3.Text = loadRow.PeculationTotalTimes3;
            this.lblPeculationTotalAmount3.Text = loadRow.PeculationTotalAmount3;
            this.lblCandorTotalAmount3.Text = loadRow.CandorTotalAmount3;
            this.lblPeculationTotalCount3.Text = loadRow.PeculationTotalCount3;
            this.lblCandorTotalCount3.Text = loadRow.CandorTotalCount3;

            this.lblPeculationYear4.Text = loadRow.PeculationYear4;
            this.lblPeculationTotalTimes4.Text = loadRow.PeculationTotalTimes4;
            this.lblPeculationTotalAmount4.Text = loadRow.PeculationTotalAmount4;
            this.lblCandorTotalAmount4.Text = loadRow.CandorTotalAmount4;
            this.lblPeculationTotalCount4.Text = loadRow.PeculationTotalCount4;
            this.lblCandorTotalCount4.Text = loadRow.CandorTotalCount4;

            this.lblPeculationYear5.Text = loadRow.PeculationYear5;
            this.lblPeculationTotalTimes5.Text = loadRow.PeculationTotalTimes5;
            this.lblPeculationTotalAmount5.Text = loadRow.PeculationTotalAmount5;
            this.lblCandorTotalAmount5.Text = loadRow.CandorTotalAmount5;
            this.lblPeculationTotalCount5.Text = loadRow.PeculationTotalCount5;
            this.lblCandorTotalCount5.Text = loadRow.CandorTotalCount5;

            //(三)廉洁自律及重大事项情况（本人认为其他需要向组织报告的重大事项）
            this.lblSection3Others.Text = loadRow.Section3Others;

            //（四）领导班子主要领导审核意见
            this.lblSection4.Text = loadRow.Section4;

            //（五）检查考评组审核意见
            this.lblSection5.Text = loadRow.Section5;

            this.lblFillDate.Text = loadRow.FillDate.ToString(JCYConstant.Date_Format_CN);

        }

        private void SwitchControls(bool isLabelsShow, bool isControlsShow)
        {
            //labels
            this.lblName.Visible = isLabelsShow;
            this.lblGender.Visible = isLabelsShow;
            this.lblDOB.Visible = isLabelsShow;
            this.lblNationality.Visible = isLabelsShow;
            this.lblCultureDegree.Visible = isLabelsShow;
            this.lblCurrentJobDay.Visible = isLabelsShow;
            this.lblCompanyPosition.Visible = isLabelsShow;
            //配偶信息
            this.lblSpouseName.Visible = isLabelsShow;
            this.lblSpouseGender.Visible = isLabelsShow;
            this.lblSpouseDOB.Visible = isLabelsShow;
            this.lblSpouseNationality.Visible = isLabelsShow;
            this.lblSpouseCultureDegree.Visible = isLabelsShow;
            this.lblSpouseCurrentJobDay.Visible = isLabelsShow;
            this.lblSpouseCompanyPosition.Visible = isLabelsShow;

            //（二）执行党风廉政建设责任制（对照检查高检院《实施办法》中职责内容填写）
            this.lblSection2.Visible = isLabelsShow;

            //(三)廉洁自律及重大事项情况

            this.lblHouseAddress.Visible = isLabelsShow;
            this.lblHouseSize.Visible = isLabelsShow;
            this.lblHouseType.Visible = isLabelsShow;
            this.lblOtherHouseAddress.Visible = isLabelsShow;
            this.lblOtherHouseSize.Visible = isLabelsShow;
            this.lblOtherHouseType.Visible = isLabelsShow;

            this.lblBusinessTravelTime.Visible = isLabelsShow;
            this.lblBusinessTravelReason.Visible = isLabelsShow;
            this.lblBusinessTravelArea.Visible = isLabelsShow;
            this.lblBusinessTravelSpenseSource.Visible = isLabelsShow;

            this.lblPersonalTravelTime1.Visible = isLabelsShow;
            this.lblPersonalTravelReason1.Visible = isLabelsShow;
            this.lblPersonalTravelArea1.Visible = isLabelsShow;
            this.lblPersonalTravelSpenseSource1.Visible = isLabelsShow;

            this.lblPersonalTravelTime2.Visible = isLabelsShow;
            this.lblPersonalTravelReason2.Visible = isLabelsShow;
            this.lblPersonalTravelArea2.Visible = isLabelsShow;
            this.lblPersonalTravelSpenseSource2.Visible = isLabelsShow;

            this.lblCarGeneral.Visible = isLabelsShow;
            this.lblCarBrand.Visible = isLabelsShow;
            this.lblCarDisplacement.Visible = isLabelsShow;
            this.lblCarPrice.Visible = isLabelsShow;

            this.lblPhoneClaimYear.Visible = isLabelsShow;
            this.lblMobilePhoneClaimStandard.Visible = isLabelsShow;
            this.lblMobilePhoneActualClaim.Visible = isLabelsShow;
            this.lblHomePhoneClaimStandard.Visible = isLabelsShow;
            this.lblHomePhoneActualClaim.Visible = isLabelsShow;

            this.lblRelatedName1.Visible = isLabelsShow;
            this.lblRelationShip1.Visible = isLabelsShow;
            this.lblRelatedJobType1.Visible = isLabelsShow;
            this.lblRelatedCompany1.Visible = isLabelsShow;
            this.lblRelatedPosition1.Visible = isLabelsShow;

            this.lblRelatedName2.Visible = isLabelsShow;
            this.lblRelationShip2.Visible = isLabelsShow;
            this.lblRelatedJobType2.Visible = isLabelsShow;
            this.lblRelatedCompany2.Visible = isLabelsShow;
            this.lblRelatedPosition2.Visible = isLabelsShow;

            this.lblRelatedName3.Visible = isLabelsShow;
            this.lblRelationShip3.Visible = isLabelsShow;
            this.lblRelatedJobType3.Visible = isLabelsShow;
            this.lblRelatedCompany3.Visible = isLabelsShow;
            this.lblRelatedPosition3.Visible = isLabelsShow;

            this.lblRelatedName4.Visible = isLabelsShow;
            this.lblRelationShip4.Visible = isLabelsShow;
            this.lblRelatedJobType4.Visible = isLabelsShow;
            this.lblRelatedCompany4.Visible = isLabelsShow;
            this.lblRelatedPosition4.Visible = isLabelsShow;

            this.lblPeculationYear1.Visible = isLabelsShow;
            this.lblPeculationTotalTimes1.Visible = isLabelsShow;
            this.lblPeculationTotalAmount1.Visible = isLabelsShow;
            this.lblCandorTotalAmount1.Visible = isLabelsShow;
            this.lblPeculationTotalCount1.Visible = isLabelsShow;
            this.lblCandorTotalCount1.Visible = isLabelsShow;

            this.lblPeculationYear2.Visible = isLabelsShow;
            this.lblPeculationTotalTimes2.Visible = isLabelsShow;
            this.lblPeculationTotalAmount2.Visible = isLabelsShow;
            this.lblCandorTotalAmount2.Visible = isLabelsShow;
            this.lblPeculationTotalCount2.Visible = isLabelsShow;
            this.lblCandorTotalCount2.Visible = isLabelsShow;

            this.lblPeculationYear3.Visible = isLabelsShow;
            this.lblPeculationTotalTimes3.Visible = isLabelsShow;
            this.lblPeculationTotalAmount3.Visible = isLabelsShow;
            this.lblCandorTotalAmount3.Visible = isLabelsShow;
            this.lblPeculationTotalCount3.Visible = isLabelsShow;
            this.lblCandorTotalCount3.Visible = isLabelsShow;

            this.lblPeculationYear4.Visible = isLabelsShow;
            this.lblPeculationTotalTimes4.Visible = isLabelsShow;
            this.lblPeculationTotalAmount4.Visible = isLabelsShow;
            this.lblCandorTotalAmount4.Visible = isLabelsShow;
            this.lblPeculationTotalCount4.Visible = isLabelsShow;
            this.lblCandorTotalCount4.Visible = isLabelsShow;

            this.lblPeculationYear5.Visible = isLabelsShow;
            this.lblPeculationTotalTimes5.Visible = isLabelsShow;
            this.lblPeculationTotalAmount5.Visible = isLabelsShow;
            this.lblCandorTotalAmount5.Visible = isLabelsShow;
            this.lblPeculationTotalCount5.Visible = isLabelsShow;
            this.lblCandorTotalCount5.Visible = isLabelsShow;

            //(三)廉洁自律及重大事项情况（本人认为其他需要向组织报告的重大事项）
            this.lblSection3Others.Visible = isLabelsShow;

            //（四）领导班子主要领导审核意见
            this.lblSection4.Visible = isLabelsShow;

            //（五）检查考评组审核意见
            this.lblSection5.Visible = isLabelsShow;

            this.lblFillDate.Visible = isLabelsShow;

            //=====================================================
            //controls
            this.txtName.Visible = isControlsShow;
            this.rbGender.Visible = isControlsShow;
            this.dtDOB.Visible = isControlsShow;
            this.txtNationality.Visible = isControlsShow;
            this.txtCultureDegree.Visible = isControlsShow;
            this.txtCurrentJobDay.Visible = isControlsShow;
            this.txtCompanyPosition.Visible = isControlsShow;
            //配偶信息
            this.txtSpouseName.Visible = isControlsShow;
            this.rbSpouseGender.Visible = isControlsShow;
            this.dtSpouseDOB.Visible = isControlsShow;
            this.txtSpouseNationality.Visible = isControlsShow;
            this.txtSpouseCultureDegree.Visible = isControlsShow;
            this.txtSpouseCurrentJobDay.Visible = isControlsShow;
            this.txtSpouseCompanyPosition.Visible = isControlsShow;

            //（二）执行党风廉政建设责任制（对照检查高检院《实施办法》中职责内容填写）
            this.txtSection2.Visible = isControlsShow;

            //(三)廉洁自律及重大事项情况

            this.txtHouseAddress.Visible = isControlsShow;
            this.txtHouseSize.Visible = isControlsShow;
            this.txtHouseType.Visible = isControlsShow;
            this.txtOtherHouseAddress.Visible = isControlsShow;
            this.txtOtherHouseSize.Visible = isControlsShow;
            this.txtOtherHouseType.Visible = isControlsShow;

            this.txtBusinessTravelTime.Visible = isControlsShow;
            this.txtBusinessTravelReason.Visible = isControlsShow;
            this.txtBusinessTravelArea.Visible = isControlsShow;
            this.txtBusinessTravelSpenseSource.Visible = isControlsShow;

            this.txtPersonalTravelTime1.Visible = isControlsShow;
            this.txtPersonalTravelReason1.Visible = isControlsShow;
            this.txtPersonalTravelArea1.Visible = isControlsShow;
            this.txtPersonalTravelSpenseSource1.Visible = isControlsShow;

            this.txtPersonalTravelTime2.Visible = isControlsShow;
            this.txtPersonalTravelReason2.Visible = isControlsShow;
            this.txtPersonalTravelArea2.Visible = isControlsShow;
            this.txtPersonalTravelSpenseSource2.Visible = isControlsShow;

            this.txtCarGeneral.Visible = isControlsShow;
            this.txtCarBrand.Visible = isControlsShow;
            this.txtCarDisplacement.Visible = isControlsShow;
            this.txtCarPrice.Visible = isControlsShow;

            this.txtPhoneClaimYear.Visible = isControlsShow;
            this.txtMobilePhoneClaimStandard.Visible = isControlsShow;
            this.txtMobilePhoneActualClaim.Visible = isControlsShow;
            this.txtHomePhoneClaimStandard.Visible = isControlsShow;
            this.txtHomePhoneActualClaim.Visible = isControlsShow;

            this.txtRelatedName1.Visible = isControlsShow;
            this.txtRelationShip1.Visible = isControlsShow;
            this.txtRelatedJobType1.Visible = isControlsShow;
            this.txtRelatedCompany1.Visible = isControlsShow;
            this.txtRelatedPosition1.Visible = isControlsShow;

            this.txtRelatedName2.Visible = isControlsShow;
            this.txtRelationShip2.Visible = isControlsShow;
            this.txtRelatedJobType2.Visible = isControlsShow;
            this.txtRelatedCompany2.Visible = isControlsShow;
            this.txtRelatedPosition2.Visible = isControlsShow;

            this.txtRelatedName3.Visible = isControlsShow;
            this.txtRelationShip3.Visible = isControlsShow;
            this.txtRelatedJobType3.Visible = isControlsShow;
            this.txtRelatedCompany3.Visible = isControlsShow;
            this.txtRelatedPosition3.Visible = isControlsShow;

            this.txtRelatedName4.Visible = isControlsShow;
            this.txtRelationShip4.Visible = isControlsShow;
            this.txtRelatedJobType4.Visible = isControlsShow;
            this.txtRelatedCompany4.Visible = isControlsShow;
            this.txtRelatedPosition4.Visible = isControlsShow;

            this.txtPeculationYear1.Visible = isControlsShow;
            this.txtPeculationTotalTimes1.Visible = isControlsShow;
            this.txtPeculationTotalAmount1.Visible = isControlsShow;
            this.txtCandorTotalAmount1.Visible = isControlsShow;
            this.txtPeculationTotalCount1.Visible = isControlsShow;
            this.txtCandorTotalCount1.Visible = isControlsShow;

            this.txtPeculationYear2.Visible = isControlsShow;
            this.txtPeculationTotalTimes2.Visible = isControlsShow;
            this.txtPeculationTotalAmount2.Visible = isControlsShow;
            this.txtCandorTotalAmount2.Visible = isControlsShow;
            this.txtPeculationTotalCount2.Visible = isControlsShow;
            this.txtCandorTotalCount2.Visible = isControlsShow;

            this.txtPeculationYear3.Visible = isControlsShow;
            this.txtPeculationTotalTimes3.Visible = isControlsShow;
            this.txtPeculationTotalAmount3.Visible = isControlsShow;
            this.txtCandorTotalAmount3.Visible = isControlsShow;
            this.txtPeculationTotalCount3.Visible = isControlsShow;
            this.txtCandorTotalCount3.Visible = isControlsShow;

            this.txtPeculationYear4.Visible = isControlsShow;
            this.txtPeculationTotalTimes4.Visible = isControlsShow;
            this.txtPeculationTotalAmount4.Visible = isControlsShow;
            this.txtCandorTotalAmount4.Visible = isControlsShow;
            this.txtPeculationTotalCount4.Visible = isControlsShow;
            this.txtCandorTotalCount4.Visible = isControlsShow;

            this.txtPeculationYear5.Visible = isControlsShow;
            this.txtPeculationTotalTimes5.Visible = isControlsShow;
            this.txtPeculationTotalAmount5.Visible = isControlsShow;
            this.txtCandorTotalAmount5.Visible = isControlsShow;
            this.txtPeculationTotalCount5.Visible = isControlsShow;
            this.txtCandorTotalCount5.Visible = isControlsShow;

            //(三)廉洁自律及重大事项情况（本人认为其他需要向组织报告的重大事项）
            this.txtSection3Others.Visible = isControlsShow;

            //（四）领导班子主要领导审核意见
            this.txtSection4.Visible = isControlsShow;

            //（五）检查考评组审核意见
            this.txtSection5.Visible = isControlsShow;

            this.dtFillDate.Visible = isControlsShow;

            this.hr6.Visible = isControlsShow;
            this.tbSubmit.Visible = isControlsShow;
        }

        protected void imgSubmit_Click(object sender, ImageClickEventArgs e)
        {
            using (IncorruptProxy proxy = new IncorruptProxy())
            {

                if (Session["EditLingDaoDangFengCheckDT"] != null)
                {
                    var editDT = (IncorruptDataSet.T_LingDaoDangFengCheckDataTable)Session["EditLingDaoDangFengCheckDT"];
                    var editRow = editDT[0];

                    //个人信息
                    editRow.Name = this.txtName.Text;
                    editRow.Gender = this.rbGender.SelectedValue;
                    editRow.DOB = this.dtDOB.SelectedDate;
                    editRow.Nationality = this.txtNationality.Text;
                    editRow.CultureDegree = this.txtCultureDegree.Text;
                    editRow.CurrentJobDay = this.txtCurrentJobDay.Text;
                    editRow.CompanyPosition = this.txtCompanyPosition.Text;
                    //配偶信息
                    editRow.SpouseName = this.txtSpouseName.Text;
                    editRow.SpouseGender = this.rbSpouseGender.SelectedValue;
                    editRow.SpouseDOB = this.dtSpouseDOB.SelectedDate;
                    editRow.SpouseNationality = this.txtSpouseNationality.Text;
                    editRow.SpouseCultureDegree = this.txtSpouseCultureDegree.Text;
                    editRow.SpouseCurrentJobDay = this.txtSpouseCurrentJobDay.Text;
                    editRow.SpouseCompanyPosition = this.txtSpouseCompanyPosition.Text;

                    //（二）执行党风廉政建设责任制（对照检查高检院《实施办法》中职责内容填写）
                    editRow.Section2 = this.txtSection2.Text;

                    //(三)廉洁自律及重大事项情况

                    editRow.HouseAddress = this.txtHouseAddress.Text;
                    editRow.HouseSize = this.txtHouseSize.Text;
                    editRow.HouseType = this.txtHouseType.Text;
                    editRow.OtherHouseAddress = this.txtOtherHouseAddress.Text;
                    editRow.OtherHouseSize = this.txtOtherHouseSize.Text;
                    editRow.OtherHouseType = this.txtOtherHouseType.Text;

                    editRow.BusinessTravelTime = this.txtBusinessTravelTime.Text;
                    editRow.BusinessTravelReason = this.txtBusinessTravelReason.Text;
                    editRow.BusinessTravelArea = this.txtBusinessTravelArea.Text;
                    editRow.BusinessTravelSpenseSource = this.txtBusinessTravelSpenseSource.Text;

                    editRow.PersonalTravelTime1 = this.txtPersonalTravelTime1.Text;
                    editRow.PersonalTravelReason1 = this.txtPersonalTravelReason1.Text;
                    editRow.PersonalTravelArea1 = this.txtPersonalTravelArea1.Text;
                    editRow.PersonalTravelSpenseSource1 = this.txtPersonalTravelSpenseSource1.Text;

                    editRow.PersonalTravelTime2 = this.txtPersonalTravelTime2.Text;
                    editRow.PersonalTravelReason2 = this.txtPersonalTravelReason2.Text;
                    editRow.PersonalTravelArea2 = this.txtPersonalTravelArea2.Text;
                    editRow.PersonalTravelSpenseSource2 = this.txtPersonalTravelSpenseSource2.Text;

                    editRow.CarGeneral = this.txtCarGeneral.Text;
                    editRow.CarBrand = this.txtCarBrand.Text;
                    editRow.CarDisplacement = this.txtCarDisplacement.Text;
                    editRow.CarPrice = this.txtCarPrice.Text;

                    editRow.PhoneClaimYear = this.txtPhoneClaimYear.Text;
                    editRow.MobilePhoneClaimStandard = this.txtMobilePhoneClaimStandard.Text;
                    editRow.MobilePhoneActualClaim = this.txtMobilePhoneActualClaim.Text;
                    editRow.HomePhoneClaimStandard = this.txtHomePhoneClaimStandard.Text;
                    editRow.HomePhoneActualClaim = this.txtHomePhoneActualClaim.Text;

                    editRow.RelatedName1 = this.txtRelatedName1.Text;
                    editRow.RelationShip1 = this.txtRelationShip1.Text;
                    editRow.RelatedJobType1 = this.txtRelatedJobType1.Text;
                    editRow.RelatedCompany1 = this.txtRelatedCompany1.Text;
                    editRow.RelatedPosition1 = this.txtRelatedPosition1.Text;

                    editRow.RelatedName2 = this.txtRelatedName2.Text;
                    editRow.RelationShip2 = this.txtRelationShip2.Text;
                    editRow.RelatedJobType2 = this.txtRelatedJobType2.Text;
                    editRow.RelatedCompany2 = this.txtRelatedCompany2.Text;
                    editRow.RelatedPosition2 = this.txtRelatedPosition2.Text;

                    editRow.RelatedName3 = this.txtRelatedName3.Text;
                    editRow.RelationShip3 = this.txtRelationShip3.Text;
                    editRow.RelatedJobType3 = this.txtRelatedJobType3.Text;
                    editRow.RelatedCompany3 = this.txtRelatedCompany3.Text;
                    editRow.RelatedPosition3 = this.txtRelatedPosition3.Text;

                    editRow.RelatedName4 = this.txtRelatedName4.Text;
                    editRow.RelationShip4 = this.txtRelationShip4.Text;
                    editRow.RelatedJobType4 = this.txtRelatedJobType4.Text;
                    editRow.RelatedCompany4 = this.txtRelatedCompany4.Text;
                    editRow.RelatedPosition4 = this.txtRelatedPosition4.Text;

                    editRow.PeculationYear1 = this.txtPeculationYear1.Text;
                    editRow.PeculationTotalTimes1 = this.txtPeculationTotalTimes1.Text;
                    editRow.PeculationTotalAmount1 = this.txtPeculationTotalAmount1.Text;
                    editRow.CandorTotalAmount1 = this.txtCandorTotalAmount1.Text;
                    editRow.PeculationTotalCount1 = this.txtPeculationTotalCount1.Text;
                    editRow.CandorTotalCount1 = this.txtCandorTotalCount1.Text;

                    editRow.PeculationYear2 = this.txtPeculationYear2.Text;
                    editRow.PeculationTotalTimes2 = this.txtPeculationTotalTimes2.Text;
                    editRow.PeculationTotalAmount2 = this.txtPeculationTotalAmount2.Text;
                    editRow.CandorTotalAmount2 = this.txtCandorTotalAmount2.Text;
                    editRow.PeculationTotalCount2 = this.txtPeculationTotalCount2.Text;
                    editRow.CandorTotalCount2 = this.txtCandorTotalCount2.Text;

                    editRow.PeculationYear3 = this.txtPeculationYear3.Text;
                    editRow.PeculationTotalTimes3 = this.txtPeculationTotalTimes3.Text;
                    editRow.PeculationTotalAmount3 = this.txtPeculationTotalAmount3.Text;
                    editRow.CandorTotalAmount3 = this.txtCandorTotalAmount3.Text;
                    editRow.PeculationTotalCount3 = this.txtPeculationTotalCount3.Text;
                    editRow.CandorTotalCount3 = this.txtCandorTotalCount3.Text;

                    editRow.PeculationYear4 = this.txtPeculationYear4.Text;
                    editRow.PeculationTotalTimes4 = this.txtPeculationTotalTimes4.Text;
                    editRow.PeculationTotalAmount4 = this.txtPeculationTotalAmount4.Text;
                    editRow.CandorTotalAmount4 = this.txtCandorTotalAmount4.Text;
                    editRow.PeculationTotalCount4 = this.txtPeculationTotalCount4.Text;
                    editRow.CandorTotalCount4 = this.txtCandorTotalCount4.Text;

                    editRow.PeculationYear5 = this.txtPeculationYear5.Text;
                    editRow.PeculationTotalTimes5 = this.txtPeculationTotalTimes5.Text;
                    editRow.PeculationTotalAmount5 = this.txtPeculationTotalAmount5.Text;
                    editRow.CandorTotalAmount5 = this.txtCandorTotalAmount5.Text;
                    editRow.PeculationTotalCount5 = this.txtPeculationTotalCount5.Text;
                    editRow.CandorTotalCount5 = this.txtCandorTotalCount5.Text;

                    //(三)廉洁自律及重大事项情况（本人认为其他需要向组织报告的重大事项）
                    editRow.Section3Others = this.txtSection3Others.Text;

                    //（四）领导班子主要领导审核意见
                    editRow.Section4 = this.txtSection4.Text;

                    //（五）检查考评组审核意见
                    editRow.Section5 = this.txtSection5.Text;

                    editRow.FillDate = this.dtFillDate.SelectedDate;
                    JCYUtility.UpdateCommonFields(editRow, "Iori");
                    proxy.UpdateLingDaoDangFengCheck(editDT);

                    Response.Redirect("LingDaoDangFengCheck.aspx");
                }
            }
        }

        protected void imgCancel_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("LingDaoDangFengCheck.aspx");
        }

        protected void lkbEditLingDaoDangFengCheck_Click(object sender, EventArgs e)
        {
            this.hfIsEdit.Value = "1";
            SwitchControls(false, true);
            if (_isApproval == "1")
            {
                this.txtSection4.Enabled = true;
                this.txtSection5.Enabled = true;
            }

            else
            {
                this.txtSection4.Enabled = false;
                this.txtSection5.Enabled = false;
            }

            this.dtFillDate.SelectedDate = Convert.ToDateTime(this.hfFillDate.Value);
            this.dtDOB.SelectedDate = Convert.ToDateTime(this.hfDOB.Value);
            this.dtSpouseDOB.SelectedDate = Convert.ToDateTime(this.hfSpouseDOB.Value);
        }
    }
}
